﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;


namespace OMSService
{
    [DataContract]
    public class CreditCardModel
    {
        int id;
        string type;
        string number;
        int cv2;
        DateTime startDate;
        DateTime expiryDate;
        string issueNumber;

        #region setters
        [DataMember]
        public int Id
        {
            get { return id; }
            private set { id = value; }
        }

        [DataMember]
        public string _Type
        {
            get { return type; }
            set { type = value; }
        }

        [DataMember]
        public string Number
        {
            get { return number; }
            set { number = value; }
        }

        [DataMember]
        public int Cv2
        {
            get { return cv2; }
            set { cv2 = value; }
        }

        [DataMember]
        public DateTime StartDate
        {
            get { return startDate; }
            set { startDate = value; }
        }

        [DataMember]
        public DateTime ExpiryDate
        {
            get { return expiryDate; }
            set { expiryDate = value; }
        }

        [DataMember]
        public string IssueNumber
        {
            get { return issueNumber; }
            set { issueNumber = value; }
        }
        #endregion

        public CreditCardModel() { }

        public CreditCardModel(string type, string number, int cv2, DateTime startDate, DateTime expiryDate, string issueNumber)
        {
            _Type = type;
            Number = number;
            Cv2 = cv2;
            StartDate = startDate;
            ExpiryDate = expiryDate;
            IssueNumber = issueNumber;
        }

        public CreditCardModel(CreditCard creditCard)
        {
            Id = creditCard.Id;
            _Type = creditCard.Type;
            Number = creditCard.Number;
            Cv2 = creditCard.Cv2;
            StartDate = creditCard.StartDate;
            ExpiryDate = creditCard.ExpiryDate;
            IssueNumber = creditCard.IssueNumber;
        }
    }
}